package van.planifolia.work1;

import van.planifolia.ListConstant;

/**
 * Created by Intellij IDEA<br>
 *
 * @author Planifolia.Van
 * @version 1.0
 * @date 2022/11/6 15:41
 */
public class Match {
    public static void main(String[] args) {
        // 判断集合中的年龄是否全部都大于18
        System.out.println(ListConstant.peoples.stream().allMatch(people -> people.getAge() > 18));
        // 判断集合中的年龄是否有大于18的
        System.out.println(ListConstant.peoples.stream().anyMatch(people -> people.getAge() > 18));
    }
}